package com.chonglie;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class ServLifecycleService extends Service {

	public static String state;

	@Override
	public IBinder onBind(Intent intent) {
		Log.e("Service", "onBind");
		state = "onBind";
		return null;
	}

	@Override
	public void onCreate() {
		super.onCreate();
		Log.e("Service", "onCreate");

		state = "onCreate";
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		Log.e("Service", "onDestroy");

		state = "onDestroy";
	}

	@Override
	public boolean onUnbind(Intent intent) {
		Log.e("Service", "onUnbind");

		state = "onUnbind";
		return super.onUnbind(intent);
	}

	@Override
	public void onRebind(Intent intent) {
		super.onRebind(intent);

		state = "onRebind";
		Log.e("Service", "onRebind");
	}

	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		Log.e("Service", "onStartCommand");

		state = "onStartCommand";
		return super.onStartCommand(intent, flags, startId);
	}

	public static String getState() {
		return state;
	}


}
